﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AjaxControlToolkit;

namespace BusinessDecision.JobAdministrator.Web
{
    public class TabContainer : AjaxControlToolkit.TabContainer
    {
        protected override void AddParsedSubObject(object obj)
        {
            WebControl child = obj as WebControl;
            if (child != null)
            {
                Controls.Add(child);
            }
            //else if (!(obj is LiteralControl))
            //{
            //    throw new HttpException(string.Format(CultureInfo.CurrentCulture, "TabContainer cannot have children of type '{0}'.", new object[] { obj.GetType() }));
            //}
        }

        protected override ControlCollection CreateControlCollection()
        {
            return new TabPanelCollection(this);
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
        public TabPanelCollection Tabs
        {
            get
            {
                return (TabPanelCollection)Controls;
            }
        }
    }
}